<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text"  v-model.trim="userName"
             placeholder="enter the name you search"/>
      <button @click="handleSearch">Search</button>
    </div>
  </section>
</template>

<script>
export default {
  name: "v-header",
  data(){
    return {
      userName:""
    }
  },
  methods:{
    handleSearch(){
      //将userName传递给list
      this.$bus.$emit("handleSearch",this.userName);
      //清空输入框
      this.userName=""
    }
  }
}
</script>

<style scoped>

</style>